<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="../../js/mui.min.js"></script>
		<link href="../../css/mui.min.css" rel="stylesheet" />
	</head>

	<body>
		<div class="mui-content">
			<form id="alipaysubmit" name="alipaysubmit" action="" method="post">
				<input type="hidden" id="sign" name="sign" />
				<input type="hidden" id="bodys" name="body" />
				<input type="hidden" id="_input_charset" name="_input_charset" />
				<input type="hidden" id="subject" name="subject" />
				<input type="hidden" id="total_fee" name="total_fee" />
				<input type="hidden" id="sign_type" name="sign_type" />
				<input type="hidden" id="service" name="service" />
				<input type="hidden" id="notify_url" name="notify_url" />
				<input type="hidden" id="partner" name="partner" />
				<input type="hidden" id="seller_id" name="seller_id" />
				<input type="hidden" id="out_trade_no" name="out_trade_no" />
				<input type="hidden" id="payment_type" name="payment_type" />
			</form>
		</div>
	</body>
	<script>
		document.addEventListener("plusready", ready, false);

		function ready() {
			var parent=plus.webview.currentWebview().opener();
			var ret = parent.alipayret;
			//根据参数传递的编码格式，动态设置表单的action值。
			var actionStr = "https://mapi.alipay.com/gateway.do?_input_charset=" + ret.obj._input_charset;
			document.getElementById('alipaysubmit').action = actionStr;
			//动态设置需要提交的表单参数
			document.getElementById("sign").value = ret.obj.sign;
			document.getElementById("bodys").value = ret.obj.body;
			document.getElementById("_input_charset").value = ret.obj._input_charset;
			document.getElementById("subject").value = ret.obj.subject;
			document.getElementById("total_fee").value = ret.obj.total_fee;
			document.getElementById("sign_type").value = ret.obj.sign_type;
			document.getElementById("service").value = ret.obj.service;
			document.getElementById("notify_url").value = ret.obj.notify_url;
			document.getElementById("partner").value = ret.obj.partner;
			document.getElementById("seller_id").value = ret.obj.seller_id;
			document.getElementById("out_trade_no").value = ret.obj.out_trade_no;
			document.getElementById("payment_type").value = ret.obj.payment_type;
			//提交表单
			document.getElementById("alipaysubmit").submit();
		}
	</script>

</html>